﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using Chat;
using Chat.GUI;
using Chat.Client.GUI;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private IPEndPointDialog dial = new IPEndPointDialog();
        private ConnectToDialog connect2 = new ConnectToDialog();

        private void btnTestIPEndPointDialog_Click(object sender, EventArgs e)
        {
            DialogResult dr = dial.ShowDialog();

            if (dr == DialogResult.OK)
            {
                IPEndPoint endPoint = dial.IpEndPoint;

                txtIPEndPoint.Text = endPoint.ToString();
            }
        }

        private void btnTestConnectToDialog_Click(object sender, EventArgs e)
        {
            DialogResult dr = connect2.ShowDialog();

            if (dr == DialogResult.OK)
            {
                IPEndPoint ep = connect2.IpEndPoint;
                LoginData ld = connect2.Login;

                txtConnect2.Text = string.Format(
                    "{0} {1}, {2}",
                    ep.ToString(), ld.User.Value, ld.TextColor.ToString());
            }
        }
    }
}
